package com.bdqn;

import com.bdqn.pojo.User;
import com.bdqn.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * <Description> <br>
 *
 * @author tao<br>
 * @version 1.0<br>
 * @taskId: <br>
 * @createDate 2019/09/06 17:00 <br>
 * @see com.bdqn <br>
 */
public class TestLogin {

    @Test
    public void testLogin(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserService userService = (UserService)context.getBean("userService");
        User u = userService.login("admin","123456");
        if (u != null ){
            System.out.println(u.toString());
        } else {
            System.out.println("用户不存在！");
        }
    }
}
